﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:clr="clr-namespace:System;assembly=mscorlib" xmlns:clr2="clr-namespace:System.Collections;assembly=mscorlib" xmlns:local="clr-namespace:WPG" xmlns:data="clr-namespace:WPG.Data" xmlns:typeeditors="clr-namespace:WPG.TypeEditors" xmlns:converters="clr-namespace:WPG.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    
	<!-- PropertyGrid Style -->
	<Style TargetType="{x:Type typeeditors:IntegerTypeEditor}">
		<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
		<Setter Property="FocusVisualStyle" Value="{x:Null}" />
		<Setter Property="AllowDrop" Value="true" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type typeeditors:IntegerTypeEditor}">
					<Grid>
						<Border x:Name="Border" Background="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyGrid}, ResourceId=WindowBackgroundBrush}}" BorderBrush="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyGrid}, ResourceId=SolidBorderBrush}}" BorderThickness="1" Padding="0" CornerRadius="2">
							<!-- The implementation places the Content into the ScrollViewer. It must be named PART_ContentHost for the control to function -->
							<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="*" />
									<ColumnDefinition Width="20" />
								</Grid.ColumnDefinitions>
								<ScrollViewer Grid.Column="0" Margin="0" x:Name="PART_ContentHost" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyGrid}, ResourceId=ScrollViewerStyle}}" Background="{TemplateBinding Background}" />
								<Grid Grid.Column="1" Width="20" VerticalAlignment="Stretch" HorizontalAlignment="Right" Margin="0">
									<Grid.RowDefinitions>
										<RowDefinition></RowDefinition>
										<RowDefinition></RowDefinition>
									</Grid.RowDefinitions>
                                    <Button ToolTip="Increase Value" Grid.Row="0" IsEnabled="{Binding Path=IsWriteable}" Command="{x:Static typeeditors:IntegerTypeEditor.UpCommand }" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0">

										<Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="Black" Data="M 0 0 L 4 4 L 8 0 Z" RenderTransformOrigin="0.5,0.5">
											<Path.RenderTransform>
												<RotateTransform Angle="-180" />
											</Path.RenderTransform>
										</Path>

									</Button>
                                    <Button ToolTip="Decrement Value" Grid.Row="1" IsEnabled="{Binding Path=IsWriteable}" Command="{x:Static typeeditors:IntegerTypeEditor.DownCommand }" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0">
										<Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="Black" Data="M 0 0 L 4 4 L 8 0 Z" RenderTransformOrigin="0.5,0.5">
											<Path.RenderTransform>
												<RotateTransform Angle="0" />
											</Path.RenderTransform>
										</Path>
									</Button>
								</Grid>
							</Grid>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>